using System;
using Framework.Audio;
using Framework.FSMLite;
using Framework.UI;
using IcecreamView;
using UnityEngine;

namespace GameSystem
{
    public class StateInit: StateMachine<GameEnum>
    {

        internal override void OnEnter(params object[] args)
        {
            var viewConfigs = Resources.Load<IC_Resource_ViewConfig>("Config/ViewConfig");
            var canvasRoot = GameObject.Find("Canvas")?.transform;
            if (viewConfigs == null)
            {
                throw new Exception("初始化UIManager失败");
            }
            UIManager.Instance.Init(viewConfigs , canvasRoot);
            //切换到Home节点
            this.stateMachineRunner.ChangeState(GameEnum.Home);
        }

        internal override void OnExit()
        {
            
        }

    }
}